package com.action.user;

// List, Content 액션
import java.util.*;
import com.db.organization.*;
import com.db.user.*;
import com.opensymphony.xwork2.ActionContext;

public class UserOutputAction {	
	private UserDAO userDAO;
	private DeptJobDAO orgDAO;
	private UserVO vo;
	// 부서 리스트, 직급 리스트 	
	private List<JobVO> jlist;
	private List<DeptVO> dlist;
	
	public void setOrgDAO(DeptJobDAO orgDAO) {
		this.orgDAO = orgDAO;
	}
	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}
	public UserVO getVo() {
		return vo;
	}
	
	public List<JobVO> getJlist() {
		return jlist;
	}	
	public List<DeptVO> getDlist() {
		return dlist;
	}
	
	public String getUserInfo(){
		String result = "";
		try {			
			ActionContext context = ActionContext.getContext();
			vo = (UserVO) context.getSession().get("user");
			vo = userDAO.getUserInfo(vo.getSabun());
			jlist = orgDAO.getJobList();
			dlist = orgDAO.getDeptList();
			result = "success";
		} catch (Exception e) {
			System.out.println("UserOutputAction.getUserInfo():"+e.toString());
			result = "error";
		}
		return result;		
	}
}
